#include<bits/stdc++.h>
using namespace std;
int n,rr,l=0x3f3f3f3f,r,maxx,ans,atks[100001],hasAtks[100001];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin >> n;
    for(int i=1;i<=n;i++){
        cin >> rr;
        atks[rr]++;
        l=min(l,rr);
        maxx=max(maxx,rr);
    }r=l+1;
    ans=n;
    while(r<maxx){
        while(l==r||!(atks[r]-hasAtks[r])&&r<maxx)r++;
        int o=atks[l];
        atks[l]=max(atks[l]-atks[r]+hasAtks[r],0);
        hasAtks[r]+=o-atks[l];
        ans-=o-atks[l];
        while(!atks[l]&&l<maxx)l++;
    }cout << ans;
    return 0;
}